<template>
  <div class="goods">
    <!-- 获取每个小组件对象(30个),将其传给 /GoodsListItem  之后它对其进行具体的展示  -->
    <GoodsListItem v-for="item in goods" :goods-item="item">
    <!--    {{goods}}是FirPage传过来的数据-->
    </GoodsListItem>
  </div>

</template>

<script>
  //大组件套小组件
  import GoodsListItem from './GoodsListItem'

  export default {
    name: "GoodsList",
    components: {
      GoodsListItem
    },
    props: {
      goods: {
        type: Array,
        default() {
          return []
        }
      }
    }
  }
</script>

<style scoped>
  .goods {
    display: flex;
    /*按宽度每行显示多少个*/
    flex-wrap: wrap;
    /*空白部分均等分*/
    justify-content: space-around;

    padding: 2px;
  }


</style>
